import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Vant from 'vant'
import 'vant/lib/index.css'
import 'amfe-flexible'
import http from '@/utils/request'
import * as filters from '@/utils/filters'
import '@/assets/less/index.less'

Vue.use(Vant)
Vue.prototype.$http = http
Vue.config.productionTip = false

for (const key of Object.keys(filters)) {
  Vue.filter(key, filters[key])
}
router.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
